package com.myidis.response;

import java.util.ArrayList;
import java.util.List;

import com.auxiliary.Line;
import com.auxiliary.SeasonAdjuster;

public class SeasonAdjustRes {
	private List<String> xAxis;
	private List<Line> lineList;
	private List<String> lineNames;

public SeasonAdjustRes(SeasonAdjuster adjust) {
		this.xAxis = adjust.getxAxis();
		lineList = new ArrayList<Line>();
		lineNames = new ArrayList<String>();
		
		lineNames.add("原序列");
		lineList.add(new Line("原序列", adjust.getXList()));
		
		lineNames.add("趋势项顺序列（TC）");
		lineList.add(new Line("趋势项顺序列（TC）", adjust.getTCList()));
		
		lineNames.add("季节调整后序列（SA）");
		lineList.add(new Line("季节调整后序列（SA）", adjust.getSAList()));
		
		lineNames.add("季节因子序列（SF）");
		lineList.add(new Line("季节因子序列（SF）", adjust.getSFList()));
		
		lineNames.add("不规则项序列（IR）");
		lineList.add(new Line("不规则项序列（IR）", adjust.getIRList()));
	}
	
	public SeasonAdjustRes(int[] checkBox, SeasonAdjuster adjust) {
		
		this.xAxis = adjust.getxAxis();
		lineList = new ArrayList<Line>();
		lineNames = new ArrayList<String>();
		for(int check: checkBox){
			switch(check){
			case 1:
				lineNames.add("原序列");
				lineList.add(new Line("原序列", adjust.getXList()));
				break;
			case 2:
				lineNames.add("趋势项顺序列（TC）");
				lineList.add(new Line("趋势项顺序列（TC）", adjust.getTCList()));
				break;
			case 3:
				lineNames.add("季节调整后序列（SA）");
				lineList.add(new Line("季节调整后序列（SA）", adjust.getSAList()));
				break;
			case 4:
				lineNames.add("季节因子序列（SF）");
				lineList.add(new Line("季节因子序列（SF）", adjust.getSFList()));
				break;
			case 5:
				lineNames.add("不规则项序列（IR）");
				lineList.add(new Line("不规则项序列（IR）", adjust.getIRList()));
				break;
			}
		}
	}
	
	public SeasonAdjustRes(int[] checkBox, List<String> xAxis, List<Double> xList, List<Double> tCList, List<Double> sAList, List<Double> sFList,
			List<Double> iRList) {
		
		this.xAxis = xAxis;
		lineList = new ArrayList<Line>();
		lineNames = new ArrayList<String>();
		for(int check: checkBox){
			switch(check){
			case 1:
				lineNames.add("原序列");
				lineList.add(new Line("原序列", xList));
				break;
			case 2:
				lineNames.add("趋势项顺序列（TC）");
				lineList.add(new Line("趋势项顺序列（TC）", iRList));
				break;
			case 3:
				lineNames.add("季节调整后序列（SA）");
				lineList.add(new Line("季节调整后序列（SA）", iRList));
				break;
			case 4:
				lineNames.add("季节因子序列（SF）");
				lineList.add(new Line("季节因子序列（SF）", iRList));
				break;
			case 5:
				lineNames.add("不规则项序列（IR）");
				lineList.add(new Line("不规则项序列（IR）", iRList));
				break;
			}
		}
		/*
		if(checkBox[0] == 1)
			XList = xList;
		if(checkBox[1] == 1)
			TCList = tCList;
		if(checkBox[2] == 1)
			SAList = sAList;
		if(checkBox[3] == 1)
			SFList = sFList;
		if(checkBox[4] == 1)
			IRList = iRList;
			*/
	}
	
	public List<String> getxAxis() {
		return xAxis;
	}

	public void setxAxis(List<String> xAxis) {
		this.xAxis = xAxis;
	}

	public List<Line> getLineList() {
		return lineList;
	}

	public void setLineList(List<Line> lineList) {
		this.lineList = lineList;
	}

	public List<String> getLineNames() {
		return lineNames;
	}

	public void setLineNames(List<String> lineNames) {
		this.lineNames = lineNames;
	}
}
